package com.booking.springrestful.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.apache.tomcat.jni.Time;

import java.io.Serializable;
import java.util.Date;
import java.util.Timer;

/**
 * 咨询师预约时间可预约状态日历表
 * @TableName counselorschedule
 */
@TableName(value ="counselorschedule")
@Data
public class Counselorschedule implements Serializable {
    /**
     * 唯一标识日历记录
     */
    @TableId(type = IdType.AUTO)
    private Integer scheduleid;

    /**
     * 咨询师ID
     */
    private Integer counselorid;

    /**
     * 咨询室
     */
    private String room;

    /**
     * 星期
     */
    private String weekend;

    /**
     * 开始时间
     */
    private Date starttime;

    /**
     * 结束时间
     */
    private Date endtime;

    /**
     * 是否可预约
     */
    private Integer isavailable;

    /**
     * 创建时间
     */
    private Date createdat;

    /**
     * 更新时间
     */
    private Date updatedat;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Counselorschedule other = (Counselorschedule) that;
        return (this.getScheduleid() == null ? other.getScheduleid() == null : this.getScheduleid().equals(other.getScheduleid()))
            && (this.getCounselorid() == null ? other.getCounselorid() == null : this.getCounselorid().equals(other.getCounselorid()))
            && (this.getRoom() == null ? other.getRoom() == null : this.getRoom().equals(other.getRoom()))
            && (this.getWeekend() == null ? other.getWeekend() == null : this.getWeekend().equals(other.getWeekend()))
            && (this.getStarttime() == null ? other.getStarttime() == null : this.getStarttime().equals(other.getStarttime()))
            && (this.getEndtime() == null ? other.getEndtime() == null : this.getEndtime().equals(other.getEndtime()))
            && (this.getIsavailable() == null ? other.getIsavailable() == null : this.getIsavailable().equals(other.getIsavailable()))
            && (this.getCreatedat() == null ? other.getCreatedat() == null : this.getCreatedat().equals(other.getCreatedat()))
            && (this.getUpdatedat() == null ? other.getUpdatedat() == null : this.getUpdatedat().equals(other.getUpdatedat()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getScheduleid() == null) ? 0 : getScheduleid().hashCode());
        result = prime * result + ((getCounselorid() == null) ? 0 : getCounselorid().hashCode());
        result = prime * result + ((getRoom() == null) ? 0 : getRoom().hashCode());
        result = prime * result + ((getWeekend() == null) ? 0 : getWeekend().hashCode());
        result = prime * result + ((getStarttime() == null) ? 0 : getStarttime().hashCode());
        result = prime * result + ((getEndtime() == null) ? 0 : getEndtime().hashCode());
        result = prime * result + ((getIsavailable() == null) ? 0 : getIsavailable().hashCode());
        result = prime * result + ((getCreatedat() == null) ? 0 : getCreatedat().hashCode());
        result = prime * result + ((getUpdatedat() == null) ? 0 : getUpdatedat().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", scheduleid=").append(scheduleid);
        sb.append(", counselorid=").append(counselorid);
        sb.append(", room=").append(room);
        sb.append(", weekend=").append(weekend);
        sb.append(", starttime=").append(starttime);
        sb.append(", endtime=").append(endtime);
        sb.append(", isavailable=").append(isavailable);
        sb.append(", createdat=").append(createdat);
        sb.append(", updatedat=").append(updatedat);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}